package schoolWork.Test3;
import java.util.*;

public class StringCompare {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        String  x=input.nextLine(),x1=input.nextLine(),x2=input.nextLine();
        String s=x;
        if(x.compareTo(x1)>0){
            if(x.compareTo(x2)<0){
                x=x2;
                x2=s;
            }
            else if(x1.compareTo(x2)<0){
                s=x1;
                x1=x2;
                x2=s;
            }
        }
        else{
            s=x;x=x1;x1=s;
            if(x.compareTo(x2)<0){
                x=x2;
                x2=s;
            }
            else if(x1.compareTo(x2)<0){
                s=x1;
                x1=x2;
                x2=s;
            }
        }
        System.out.println(x);
        System.out.println(x1);
        System.out.println(x2);
    }
}
